<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../../resources/home/css/css.css" rel="stylesheet" type="text/css" />
<link href="../../resources/home/css/common.css" rel="stylesheet" tyle="text/css" />
<script src="../../resources/home/js/jquery.min.1.8.2.js" type="text/javascript"></script>
<script src="../../resources/home/js/jquery.SuperSlide.2.1.1.js" type="text/javascript"></script>
<script src="../../resources/home/js/common_js.js" type="text/javascript"></script>
<script src="../../resources/home/js/footer.js" type="text/javascript"></script>
<title>茶叶商城首页</title>
</head>
<script>
function addFavorite(url, title) {
	try {
		window.external.addFavorite(url, title);
	} catch (e){
		try {
			window.sidebar.addPanel(title, url, '');
        	} catch (e) {
			alert("请按 Ctrl+D 键添加到收藏夹", 'notice');
		}
	}
}

function timer(intDiff) {
   var timer = window.setInterval(function() {
        var day = 0,
            hour = 0,
            minute = 0,
            second = 0; //时间默认值     
        if(intDiff > 0) {
            day = Math.floor(intDiff / (60 * 60 * 24));
            hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
            minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
            second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
        }
        if(minute <= 9) minute = '0' + minute;
        if(second <= 9) second = '0' + second;
        for(var i=1;i<=5;i++)
       	{
        	 $('#day'+i).html(day + "天");
             $('#hour'+i).html('<s id="h"></s>' + hour + '时');
             $('#minute'+i).html('<s></s>' + minute + '分');
             $('#second'+i).html('<s></s>' + second + '秒');
       	}
        
       
        
        if (intDiff <= 0) {
        	
            clearInterval(timer);   //定时器清除；
            
        }
        intDiff--
    }, 1000);
}
$(function() {
	//当前系统时间
	var date = new Date();
    
  //截止的年月日时分秒
   // var a = '2021-5-30 18:05:20';
    var a = $('#time').val();
    var date_line = new Date(a.replace(/-/g, '/'));
    
    //间隔时间（毫秒）
    var gap_time = date_line.getTime()-date.getTime()
    
    var intDiff = parseInt(gap_time/1000); 
	
    timer(intDiff);
});

</script>


<body>
<%@include file="../common/common_top.jsp"%>
<input type="hidden" value="<fmt:formatDate value="${time}" pattern="yyyy-MM-dd HH:mm:ss"/>" id="time" />
<!--菜单栏样式-->
<!--导航栏样式-->
<div id="Menu" class="clearfix">
  <div class="Menu_style">
  <div id="allSortOuterbox">
    <div class="Category"><a href="/TeaShop/home/product/list" class="Menu_img"><em></em></a></div>
    <div class="hd_allsort_out_box_new">
	 <!--左侧栏目开始-->
	 <div class="Menu_list">	
	    <div class="menu_title">茶叶品种</div>
      		<c:forEach items="${teaCategoryList}" var="teaCategory">
				<a href="${teaCategory.href}">${teaCategory.name}</a>
			 </c:forEach>
	</div>	
    <div class="Menu_list">	
	    <div class="menu_title">茶叶价格</div>
        <a href="/TeaShop/home/product/list?price=1&flag2=1">100以下</a>
        <a href="/TeaShop/home/product/list?price=2&flag2=1">100-200</a>
        <a href="/TeaShop/home/product/list?price=3&flag2=1">200-400</a>
        <a href="/TeaShop/home/product/list?price=4&flag2=1">400-600</a>
        <a href="/TeaShop/home/product/list?price=5&flag2=1">600-1000</a>
        <a href="/TeaShop/home/product/list?price=6&flag2=1">1000以上</a>
	</div>	
     <div class="Menu_list">	
	    <div class="menu_title">推荐茶叶</div>
        <ul class="recommend">
       			<c:set var="count" value="0"></c:set>
               	<c:forEach items="${teaListByActionId}" var="tea">
               		<!-- 只允许显示2个 -->
               		<c:if test="${count < 2}">
	         			 	<li><a href="${tea.href}" title="${tea.name}">${tea.name}</a></li>
	               		  	<c:set var="count" value="${count+1}"></c:set>
         			</c:if>
         		</c:forEach>
        </ul>
	</div>	
	</div>		
	</div>
	<!--菜单栏-->
	<div class="Navigation" id="Navigation">
		 <ul class="Navigation_name">
			<li><a class="nav_on" id="mynav"  href="/TeaShop/home/system/index"><span>首页</span></a></li>
			 <c:forEach items="${teaCategoryList}" var="teaCategory">
				<li><a class="nav_on" id="mynav"  href="${teaCategory.href}"><span>${teaCategory.name}</span></a></li>
			 </c:forEach>
		 </ul>			 
		</div>
	<script>$("#Navigation").slide({titCell:".Navigation_name li"});</script>
    <!--购物车-->	
    
     <div class="hd_Shopping_list" id="Shopping_list">
   <div class="s_cart"><em></em><a href="/TeaShop/home/shopping/cart">我的购物车</a> <i class="ci-right">&gt;</i><i class="ci-count" id="shopping-amount">${cartTotal}</i></div>
   <div class="dorpdown-layer">
    <div class="spacer"></div>
	 <!--<div class="prompt"></div><div class="nogoods"><b></b>购物车中还没有商品，赶紧选购吧！</div>-->
	 <ul class="p_s_list">
	 
	 	 <c:set var="totalPrice" value="0"></c:set>
 		 <c:forEach items="${cartList}" var="cart" varStatus="vs">
			  <li>
			    <div class="img"><img src="${cart.tea.photo}" style="width:40px;height:40px;"></div>
			    <div class="content">
			      <p><a href="${cart.tea.href}">${cart.tea.name}</a></p><p>${cart.tea.info}</p>
			    </div>
				<div class="Operations">
				<p class="Price">￥${cart.tea.new_price}</p>
				<p>数量：${cart.num}</p></div>
			  </li>
			   <c:set var="totalPrice" value="${totalPrice+cart.tea.new_price*cart.num}"></c:set>
		 </c:forEach>
		  
	</ul>		
	 <div class="Shopping_style">
	 <div class="p-total">共<b>${cartTotal}</b>件商品　共计<strong>￥ ${totalPrice}</strong></div>
	  <a href="/TeaShop/home/shopping/cart" title="去购物车结算" id="btn-payforgoods" class="Shopping">去购物车结算</a>
	 </div>	 
   </div>	
  </div>
</div>
<!--幻灯片样式-->
<div class="Plates"  id="mian">
<div class="bottom_style clearfix">
    <div class="image_display">
	<!--幻灯片样式-->
	  <div class="slider">
	   <div id="slideBox" class="slideBox">
			<div class="hd">
				<ul></ul>
			</div>
			<div class="bd">
				<ul>
					<li><a  target="_blank"><img src="../../resources/home/images/ad-1.png" /></a></li>
			        <li><a  target="_blank"><img src="../../resources/home/images/ad-3.jpg" /></a></li>
				</ul>
			</div>
			<a class="prev" href="javascript:void(0)"></a>
			<a class="next" href="javascript:void(0)"></a>
		</div>
		<script type="text/javascript">
		jQuery(".slideBox").slide({titCell:".hd ul",mainCell:".bd ul",autoPlay:true,autoPage:true,interTime:9000});
		</script>
	  </div>     
      </div>
      </div>
      <!--内容样式-->
        <div class="Selling_list">        
         <div id="slideBox_list" class="slideBox_list">
           <div class="hd">
				<span class="arrow"><a class="next"></a><a class="prev"></a></span>
				<ul><li>热销产品</li><li>新品推荐</li><li>限时促销</li></ul>
			</div>
			<div class="bd">
			<!-- 热销产品 -->
			 <ul>
			 	<c:set var="count_hot" value="0"></c:set>
         		<c:forEach items="${teaList}" var="tea">
         			<c:if test="${tea.action.id == 1 && count_hot < 5}">
						<li class="s_Products">
	                     <div class="Products_list_name">
						   <div class="img center"><a href="${tea.href}"><img src="${tea.photo}"  style="width:230px;height:180px;"/></a></div>
						   <div class="title_name"><a href="${tea.href}">${tea.name}</a></div>
						   <div class="s_Price clearfix">
	                       <span class="Current_price">商城价<em>￥${tea.new_price}</em></span>
	                       <span class="Original_Price">原价&nbsp;<em>${tea.pre_price}</em></span>
	                       </div>
	                       <div class="p_comment">
	                       	<span style="float:left">已有<font color="red">${tea.commentNumber}</font>人评论</span>
	                      	<span style="float:right"> 已售<font color="red">${tea.saleNumber}</font>份</span>
	                      		
	                       
	                       </div>
	                      </div>
						</li>	
						<c:set var="count_hot" value="${count_hot+1}"></c:set>
					</c:if>
					
				</c:forEach>
                       	
             </ul>
             <!-- 新品推荐 -->
             <ul>
             	<c:set var="count_new" value="0"></c:set>
             	<c:forEach items="${teaList}" var="tea">
         			<c:if test="${tea.action.id == 2 && count_new < 5}">
						<li class="s_Products">
						<em class="icon_new"></em>
	                     <div class="Products_list_name">
						   <div class="img center"><a href="${tea.href}"><img src="${tea.photo}"  style="width:230px;height:180px;"/></a></div>
						   <div class="title_name"><a href="${tea.href}">${tea.name}</a></div>
						   <div class="s_Price clearfix">
	                       <span class="Current_price">商城价<em>￥${tea.new_price}</em></span>
	                       <span class="Original_Price">原价&nbsp;<em>${tea.pre_price}</em></span>
	                       </div>
	                       <div class="p_comment">
	                       	<span style="float:left">已有<font color="red">${tea.commentNumber}</font>人评论</span>
	                      	<span style="float:right"> 已售<font color="red">${tea.saleNumber}</font>份</span>
	                      		
	                       
	                       </div>
	                       </div>
						</li>
						<c:set var="count_new" value="${count_new+1}"></c:set>	
					</c:if>
					
				</c:forEach>
					
             </ul>
             <!-- 限时促销 -->
             <ul>
             	<c:set var="count_time" value="0"></c:set>
             	<c:forEach items="${teaListByActionId}" var="tea" varStatus="vs">
         			<c:if test="${count_time < 5}">
						<li class="s_Products">
	                     <div class="Products_list_name">
						   <div class="img center"><a href="${tea.href}"><img src="${tea.photo}" style="width:230px;height:180px;"/></a></div>
						   <div class="title_name"><a href="${tea.href}">${tea.name}</a></div>
						   <div class="s_Price clearfix">
	                       <span class="Current_price">商城价<em>￥${tea.new_price}</em></span>
	                       <span class="Original_Price">原价&nbsp;<em>${tea.pre_price}</em></span>
	                       </div>
	                      	
	                       		<div class="time">剩余时间：<i id="day${vs.count}">0天</i><i id="hour${vs.count}">0时</i><i id="minute${vs.count}">0分</i><i id="second${vs.count}">0秒</i></div>
                      		
	                       </div>
						</li>	
					</c:if>
					<c:set var="count_time" value="${count_time+1}"></c:set>
				</c:forEach>
             </ul>
            </div>
         </div>
         <script type="text/javascript">jQuery(".slideBox_list").slide();</script>
       </div>
       
       
       
       <!--产品系列样式表-->
       <div class="Area"> 
         <div class="Area_title">
         <div class="name"><em class="icon_title"></em>巴山雀舌系列</div>
         <div class="right">
         <span class="p_link">
         	<c:forEach items="${teaCategoryList}" var="teaCategory">
				<a href="#">${teaCategory.name}</a>
			</c:forEach>
         </span>
         <span class="more">更多《</span>
         </div>
         </div>
         <div class="Area_list clearfix">
          <div class="Area_ad">
            <img src="../../resources/home/images/AD-04.jpg" />
            <img src="../../resources/home/images/AD-03.jpg" />
          </div>
          <div class="Area_p_list">
          <ul>
          
                <c:set var="count" value="0"></c:set>
               	<c:forEach items="${teaList}" var="tea">
               		<!-- 只允许显示8个 -->
               		<c:if test="${count < 8}">
               		
	         			<c:if test="${tea.teaCategory.id == 7}">
	         			 	<li class="s_Products">
	            				<div class="Area_product_c">
			         				<div class="img center"><a href="${tea.href}"><img src="${tea.photo}"  style="width:230px;height:180px;" /></a></div>
									   <div class="title_name"><a href="${tea.href}">${tea.name}</a></div>
									   <div class="s_Price clearfix">
				                       <span class="Current_price">商城价<em>￥${tea.new_price}</em></span>
				                       <span class="Original_Price">原价&nbsp;<em>${tea.pre_price}</em></span>
			               			</div>
	               				</div>
	          				 </li>
	               		  	<c:set var="count" value="${count+1}"></c:set>
	         			</c:if>
         			
         			</c:if>
         		</c:forEach>
               
              
               
            
           
          </ul>
          </div>
         </div>
       </div>
       <!--产品版块-->
        <div class="Area"> 
         <div class="Area_title">
         <div class="name"><em class="icon_title"></em>贡茗茶系列</div>
         <div class="right">
         <span class="p_link">
         	 <c:forEach items="${teaCategoryList}" var="teaCategory">
				<a  href="#"><span>${teaCategory.name}</span></a>
			 </c:forEach>
         </span>
         <span class="more">更多《</span>
         </div>
         </div>
         <div class="Area_list clearfix">
          <div class="Area_ad">
           	<img src="../../resources/home/images/AD-02.jpg" style="width:198px;height:283px;" />
            <img src="../../resources/home/images/AD-01.jpg"  style="width:198px;height:283px;"/>
          </div>
          <div class="Area_p_list">
          <ul>
          
           		<c:set var="count" value="0"></c:set>
               	<c:forEach items="${teaList}" var="tea">
               		<!-- 只允许显示8个 -->
               		<c:if test="${count < 8}">
               		
	         			<c:if test="${tea.teaCategory.id == 1}">
	         			 	<li class="s_Products">
	            				<div class="Area_product_c">
			         				<div class="img center"><a href="${tea.href}"><img src="${tea.photo}"  style="width:230px;height:180px;" /></a></div>
									   <div class="title_name"><a href="${tea.href}">${tea.name}</a></div>
									   <div class="s_Price clearfix">
				                       <span class="Current_price">商城价<em>￥${tea.new_price}</em></span>
				                       <span class="Original_Price">原价&nbsp;<em>${tea.pre_price}</em></span>
			               			</div>
	               				</div>
	          				 </li>
	               		  	<c:set var="count" value="${count+1}"></c:set>
	         			</c:if>
         			
         			</c:if>
         		</c:forEach>
          
          </ul>
          </div>
         </div>
       </div>
       
       <!--信息内容样式-->
       <div class="bs_info_area clearfix">
       <!--百科知识-->
        <div class="know_how left">
        <div class="title_name"><em class="title_icon"></em>茶叶百科  <a href="">更多》</a></div>
        <div class="info_content">
         <uL>
          <li><em class="info_icon"></em><a href="#">乌龙茶的功效与作用</a></li>
          <li><em class="info_icon"></em><a href="#">大红袍属于什么茶</a></li>
          <li><em class="info_icon"></em><a href="#">普洱茶的功效与作用</a></li>
          <li><em class="info_icon"></em><a href="#">乌龙茶的功效与作用</a></li>
          <li><em class="info_icon"></em><a href="#">绿茶的功效与作用</a></li>
          <li><em class="info_icon"></em><a href="#">乌龙茶的功效与作用</a></li>
          <li><em class="info_icon"></em><a href="#">铁观音属于什么茶</a></li>
           <li><em class="info_icon"></em><a href="#">铁观音属于什么茶</a></li>
         </uL>
        </div>
        </div>
        <!--巴山雀舌信息-->
        <div class="info_about left">
         <div class="title_name"><em class="title_icon"></em>巴山介绍 <a href="#">查看详细》</a></div>
         <div class="info_content bs_about">
          <img src="../../resources/home/images/logo_img_03.png" />
          巴山雀舌，品种：绿茶，产于四川省万源市，境内环境优美，土壤、气候特别适宜茶树生长，茶叶自然品质好，并天然富硒。巴山雀舌系采用其茶树的 高档原料精心制作而成，其品质特征外形扁平匀直，绿润带毫。经水冲泡叶底嫩绿明亮，香气鲜嫩持久，滋味醇爽回甘，汤色嫩绿明亮。<br />
           茶叶以富含硒而出名，抗氧化能力强，能清除水中污染毒素，故具有延缓衰老，防癌抗癌，抗高血压，防止色素堆积，增强机体活力，防辐射等作用。
    巴山雀舌”先后获得国家省部级以上奖项达60余次,产品曾先后获得“中国文化名茶”、“四川省十大名茶”、“四川省名牌产品”...
         </div>
        </div>
        <!--新闻中心-->
        <div class="mews right">
         <div class="title_name"><em class="title_icon"></em>文化底蕴<a href="#">更多》</a></div>
         <div class="info_content news">
          <ul>
          <li class="Headlines_news">
           <a href="#" class="news_img"><img src="../../resources/home/images/news_img.jpg" /></a>
           <a href="#">1991年“七·五”星火科技成果巴山雀舌获金奖江总书记视...</a>
           <p class="news_Profile">星火科技成果巴山雀舌获金奖江总书记视察巴山雀舌展台</p>
          </li>
          <li><a href="#">006年11月巴山雀舌获“四川省十大名茶”</a></li>
          <li><a href="#">2007年十月中国食品协会授予万源市“中国富硒...</a></li>
          <li><a href="#">张爱萍将军为巴山雀舌提字</a></li>
          <li><a href="#">巴山雀舌茶历史可追溯到西周年代</a></li>
          </ul>        
         </div>
        </div>       
       </div>
</div>
<%@include file="../common/footer.jsp"%>
</body>
</html>
